<template>
  <div class='info first-box'>
    <List :data="listData"></List>
  </div>
</template>
<script>
import List from './list'
export default {
  components: {List},
  name: "",
  data() {
    return {
      listData:[
         {
          type:3,
          name:"车医生小秘书",
          content:"",
          img:require("../../../assets/img/vip/info/1.png"),
          num:"0"
        },{
          type:2,
          name:"通知消息",
          content:"",
          img:require("../../../assets/img/vip/info/2.png"),
          num:"0"
        },{
          type:1,
          name:"福利社",
          content:"",
          img:require("../../../assets/img/vip/info/3.png"),
          num:"0"
        },
      ]
    };
  },
  methods: {
    getList(){
      var params={
        userId:sessionStorage.getItem("userId")
      }
      _g.apiPost("vipInfo/init.do",params).then(res=>{
        res.data.forEach(ele => {
            this.listData.forEach(ele1=>{
              if(ele1.type==ele.type){
                this.$set(ele1,"num",ele.num)
              }
            })
        });
      })
    }
  },
  created() {
    this.getList()
  }
};
</script>
<style lang="scss" scoped>
.info {
}
</style>